import Vue from 'vue'
import VueRouter from 'vue-router'
// 初始化加载
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   name: '/home',
  //   component: Home
  // },
  {
    path: "/register",
    name: "Register",
    // 组件，与上面的import，不一样，此处import是函数，这种写法用的时候才加载，懒加载方法
    // 也可以继续.then()或.catch()，肯定是异步的，只有异步才能懒加载
    component: () => import('@/views/Register.vue')
  },
  {
    path: "/",
    name: "Login",
    component: () => import('@/views/Login.vue')
  },
  {
    path: "/personal",
    name: "Personal",
    component: () => import('@/views/Personal.vue')
  },
  {
    path: "/patient",
    name: "Patient",
    component: () => import('@/views/Patient.vue')
  },
  {
    path: "/authorization",
    name: "Authorization",
    component: () => import('@/views/Authorization.vue')
  },
  {
    path: "/addVisitor1",
    name: "AddVisitor1",
    component: () => import('@/views/AddVisitor1.vue')
  },
  {
    path: "/addVisitor2",
    name: "AddVisitor2",
    component: () => import('@/views/AddVisitor2.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
